package com.airticketbooking.controller.manager;

import com.airticketbooking.common.domain.Result;
import com.airticketbooking.po.Airport;
import com.airticketbooking.service.AirportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RequestMapping("air/manager/Airport")
@RestController
@Api(tags = "用户机场查询相关接口")
@RequiredArgsConstructor
@Slf4j
public class MAirportController {

	private final AirportService airportService;

	@GetMapping()
	@ApiOperation(value = "获取所有机场信息")
	public Result<List<Airport>> getAirports() {

		List<Airport> airports = airportService.getAirports();

		return Result.ok(airports);
	}

}
